
#include <iostream>
#include <cstdio>
using namespace std;

class A {
	public:
		A( ) { cout << "A( )" << endl; }
		~A( ) { cout << "~A( )" << endl; }
};

class C {
	public:
		C( ) : m_p( new int ) {

			cout << "C( )" << endl;
			FILE* pfile = fopen("./cfg", "r");
			if( !pfile ) {
				delete m_p;
				throw -1;
			}
		}
		~C( ) {	
			delete m_p;
			cout << "~C( )" << endl;
		}
	private:
		A m_a;
		int* m_p;
};

// designer
// ------------------------------------------------------------------
// user

int main( void ) {
	try {
		C c;
	}
	catch( ... ) {
	}

	return 0;
}

